package com.coolbi.onsupai.core.dao.impl;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;

import com.coolbi.onsupai.core.dao.RefundGoodsDao;
import com.coolbi.onsupai.core.entity.RefundGoods;
import com.coolbi.onsupai.core.mapper.RefundGoodsMapper;

public class RefundGoodsDaoImpl implements RefundGoodsDao {

	@Autowired
	private RefundGoodsMapper refundGoodsMapper;
	public void setRefundGoodsMapper(RefundGoodsMapper refundGoodsMapper) {
		this.refundGoodsMapper = refundGoodsMapper;
	}
	
	@Override
	public RefundGoods save(RefundGoods obj) {
		refundGoodsMapper.save(obj);
		return obj;
	}

	@Override
	public int delete(long id) {
		return refundGoodsMapper.delete(id);
	}

	@Override
	public int update(RefundGoods obj) {
		return refundGoodsMapper.update(obj);
	}

	@Override
	public RefundGoods get(long id) {
		return refundGoodsMapper.get(id);
	}

	@Override
	public List<RefundGoods> list() {
		return refundGoodsMapper.list();
	}

	@Override
	public List<RefundGoods> listByPage(int offset, int limit) {
		Map<String, Object> parameter = new HashMap<String, Object>();
		parameter.put("offset", offset);
		parameter.put("limit", limit);
		return refundGoodsMapper.listByPage(parameter);
	}

	@Override
	public List<RefundGoods> find(Map<String, Object> parameter) {
		return refundGoodsMapper.listByParameter(parameter);
	}

	@Override
	public List<RefundGoods> findByPage(Map<String, Object> parameter,
			int offset, int limit) {
		parameter.put("offset", offset);
		parameter.put("limit", limit);
		return refundGoodsMapper.listByParameterPage(parameter);
	}

	@Override
	public List<RefundGoods> search(Map<String, Object> parameter, int offset,
			int limit) {
		parameter.put("offset", offset);
		parameter.put("limit", limit);
		return refundGoodsMapper.search(parameter);
	}

	@Override
	public int count() {
		return refundGoodsMapper.count();
	}

	@Override
	public int countByKeyWord(Map<String, Object> parameter) {
		return refundGoodsMapper.countByKeyWord(parameter);
	}

	@Override
	public int count(Map<String, Object> parameter) {
		return refundGoodsMapper.countByParameter(parameter);
	}

}
